<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="Content-Style-Type" content="text/css"/>
<title>
 <?php
// error_reporting(E_ALL);
    if ( is_404() ) {
        echo "BainbridgeDaily "; ?> | 404 Nothing Found <?php
    }
    else {
        echo "BainbridgeDaily "; ?> | <?php bloginfo('description');
    }
?>
</title>

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
 <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
 <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<script src="/js/daily.js" type="text/javascript"></script>
</head>
<body>

<?php

$logout = @$_GET['logout'];
$usr = @$_POST['usr'];
$pwd = @$_POST['pwd'];

global $context;
if(isset($logout)) {
    $context->Logout();
}

if(isset($usr) && isset($pwd)) {
    $id = $context->EmailPasswordToID($usr, $pwd);
    if($id > 0) {
        $context->LoginForID($id);
    }
}

echo "<div id='container-daily'>
      <div id='header-daily'>
      <div id='login-daily'>\n";

if(! $context->IsLoggedIn()) {
    echo "<form id='form-login' name='form-login' action='' method='post'>
        <input type='submit' name='submit' class='submit-link' value='Member Sign In:'/>
        <input name='usr' id='user_login' type='text' class='input-text' size='15'/>
        <input name='pwd' id='user_pass' type='password' class='input-text' value='' size='15'/>
        <a style='display: inline; margin-right: 2em' href='http://www.onebainbridge.org/wp-register.php'>Become a Member. Free!</a>
        </form>\n";
}
else {
    echo "
    <div id='logged-in'>
    <a href='http://www.onebainbridge.org/daily?logout=1'>Sign out {$context->UserFullName()}</a>
    </div>\n";
}
echo "</div>\n";

echo "
    <h1>BainbridgeDaily</h1>
    <h2> </h2>
    <h2>The Island Wide Web</h2>\n";
 echo "</div>\n";

 $_date = date( "l F j, Y g:i a");
 echo "
    <div id='news-date'>{$_date}</div>
    <ul id='news-nav'>
        <li><a href='http://www.onebainbridge.org'>OneBainbridge</a></li>
        <li><a href='http://www.onebainbridge.org/townmeeting'>TownMeeting</a></li>
        <li><a href='mailto://admin@onebainbridge.org'>Contact</a></li>
    </ul>\n";
?>
